Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt to API changes in BehaviorTree #172

Closed
wants to merge 1 commit into from

Conversation

galou
Copy link

@galou galou commented Sep 22, 2022

The change was introduced in 474f33b and was mentioned in #169 and #171 .

The change was introduced in 474f33b.
@galou
Copy link
Author

galou commented Oct 5, 2022

Any comment?

@enfuri51
Copy link

enfuri51 commented Oct 8, 2022

When change the code as you mentioned, the build will throw the error like this. Is the correction complete? @galou
error: invalid initialization of reference of type ‘const std::set<std::__cxx11::basic_string<char> >&’ from expression of type ‘std::unordered_map<std::__cxx11::basic_string<char>, BT::NodeType>’ 199 | BT::VerifyXML(xml_text, registered_nodes); // may throw

@galou
Copy link
Author

galou commented Oct 17, 2022

My changes were compatible with BehaviorTree/BehaviorTree.CPP@b3171a5 but not with the latest master of BehaviorTree.CPP. I'll try to figure out again what is wrong.

@galou
Copy link
Author

galou commented Oct 17, 2022

I wrote a fix that allows to compile again but Groot segfaults after click on "START" on the welcome dialog...

@galou
Copy link
Author

galou commented Oct 17, 2022

I just realized that the fix actually reverts the fist commit I wrote. I must have used an outdated version of BehaviorTree.CPP.

@galou galou closed this Oct 17, 2022
@galou galou reopened this Oct 17, 2022
@Affonso-Gui
Copy link
Contributor

This fixed my build with BehaviorTree.CPP version 3.8! 👍

@facontidavide
Copy link
Contributor

I will change the version of the BT.CPP library in the git submodule and merge this. Thanks

@tonynajjar
Copy link

Having the same issue after the galactic sync, these changes fixes the build of Groot

@galou
Copy link
Author

galou commented Nov 3, 2022

My changes were compatible with BehaviorTree/BehaviorTree.CPP@b3171a5 but not with the latest master of BehaviorTree.CPP. I'll try to figure out again what is wrong.

@facontidavide
Copy link
Contributor

Fixed ee66489

@tharaka27
Copy link

catkin_ws/src/Groot/bt_editor/XML_utilities.cpp: In function \u2018bool VerifyXML(QDomDocument&, const std::vector<QString>&, std::vector<QString>&)\u2019:
/home/ros/catkin_ws/src/Groot/bt_editor/XML_utilities.cpp:203:33: error: invalid initialization of reference of type \u2018const std::set<std::__cxx11::basic_string<char> >&\u2019 from expression of type \u2018std::unordered_map<std::__cxx11::basic_string<char>, BT::NodeType>\u2019
  203 |         BT::VerifyXML(xml_text, registered_nodes); // may throw
      |                                 ^~~~~~~~~~~~~~~~
In file included from /home/ros/catkin_ws/src/Groot/bt_editor/XML_utilities.cpp:6:
/catkin_ws/src/BehaviorTree.CPP/include/behaviortree_cpp_v3/xml_parsing.h:38:45: note: in passing argument 2 of \void BT::VerifyXML(const string&, const std::set<std::__cxx11::basic_string<char> >&)\u2019
   38 |                const std::set<std::string> &registered_nodes);
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/behavior_tree_editor.dir/build.make:251: CMakeFiles/behavior_tree_editor.dir/bt_editor/XML_utilities.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:247: CMakeFiles/behavior_tree_editor.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Error still persists even after using submodule.
Any suggestions please ?

@facontidavide
Copy link
Contributor

facontidavide commented Nov 17, 2022

Look at your log 😉

/catkin_ws/src/BehaviorTree.CPP/include/behaviortree_cpp_v3/xml_parsing.h

You are still using catkin (discouraged) and the version of BehaviorTree used is the one in the folder /catkin_ws/src/BehaviorTree.CPP, not the submodule.

Compile with plain cmake, not catkin

@facontidavide facontidavide reopened this Nov 17, 2022
@tharaka27
Copy link

tharaka27 commented Nov 17, 2022

Thanks a lot :) I didn't notice that I had another BehaviorTreeRepo

@tianyaohu
Copy link

tianyaohu commented Jan 20, 2024

Hey I tried to build with cmake --build -build as in README, the XML_utilities.cpp compilation error still exists

/home/user/ros2_ws/Groot/bt_editor/XML_utilities.cpp:203:33: error: invalid initialization of reference of type 'const std::set<std::__cxx11::basic_string<char> >&' from expression of type 'std::unordered_map<std::__cxx11::basic_string<char>, BT::NodeType>'
  203 |         BT::VerifyXML(xml_text, registered_nodes); // may throw
      |                                 ^~~~~~~~~~~~~~~~
In file included from /home/user/ros2_ws/Groot/bt_editor/XML_utilities.cpp:6:
/opt/ros/noetic/include/behaviortree_cpp_v3/xml_parsing.h:38:45: note: in passing argument 2 of 'void BT::VerifyXML(const string&, const std::set<std::__cxx11::basic_string<char> >&)'
   38 |                const std::set<std::string> &registered_nodes);
      |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/behavior_tree_editor.dir/build.make:251: CMakeFiles/behavior_tree_editor.dir/bt_editor/XML_utilities.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:303: CMakeFiles/behavior_tree_editor.dir/all] Error 2
make: *** [Makefile:141: all] Error 2```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants